<template>
    <div>
        <Modal width="600"
               v-model="modalcode.udpateModalFlag"
               @on-ok="ok"
               @on-cancel="cancel"
               draggable
               scrollable
               title="字典修改">
            <Form :label-width="100">
                <FormItem label="字典类型：">
                    <Input disabled v-model="modalcode.codedata.codeType" />
                </FormItem>
                <FormItem label="字典名称：">
                    <Input  v-model="modalcode.codedata.codeName" />
                </FormItem>
            </Form>
        </Modal>
    </div>
</template>

<script>
    export default {
        props:{
            modalcode:{
                udpateModalFlag:false,
                codedata:{}
            }
        },
        methods:{
            ok(){
                this.http.post("/code/updatecode",this.qs.stringify(this.modalcode.codedata)).then(res=>{
                    if(res.data){
                        this.$parent.getAllCode()
                        this.$Message.success("修改成功！！！")
                    }
                }).finally(res=>{
                    this.$emit("changeaddModel",false)
                })

            },
            cancel(){
                this.$parent.getAllCode()
                this.$emit("changeaddModel",false)
            }
        }
    }
</script>

<style scoped>

</style>
